/*
 * Copyright (C) 2008 GeoScheduler Team, as stated on <http://www.geoscheduler.org/authors>.
 * 
 * This file is part of GeoScheduler.
 * 
 * GeoScheduler is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * GeoScheduler is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with GeoScheduler. If not, see <http://www.gnu.org/licenses/>.
 */
package org.geoscheduler.rest;

import javax.annotation.Resource;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.ProduceMime;

import org.geoscheduler.rest.utils.MIMEConstants;
import org.geoscheduler.rest.version.APIVersion;
import org.json.JSONObject;

/**
 * Returns current version of REST API.
 * 
 * This can be used by clients to check whether remote server is responding and whether
 * it supports expected API version. 
 *
 * @author srakyi
 */
@Resource
@Path("apiversion")
public class APIVersionResource extends AbstractResource {
	public APIVersionResource() {
		super();
	}
	
	@GET
	@ProduceMime(MIMEConstants.APP_JSON)
	public JSONObject getVersion() {
		return response(new APIVersion());
	}
}
